/* eslint-disable */
// @ts-ignore
import request from '@/http/vue-query';
import { CustomRequestOptions_ } from '@/http/types';

import * as API from './types';

/** 上传文件 上传文件，上传后返回文件url POST /file/upload */
export function fileUploadUsingPost({
  body,
  options,
}: {
  body: API.FileUploadUsingPostBody;
  options?: CustomRequestOptions_;
}) {
  return request<API.ResultString>('/file/upload', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 上传图片 上传图片,上传后返回原图和缩略图的url POST /image/upload */
export function imageUploadUsingPost({
  params,
  body,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.ImageUploadUsingPostParams;
  body: API.ImageUploadUsingPostBody;
  options?: CustomRequestOptions_;
}) {
  return request<API.ResultUploadImageVO>('/image/upload', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      // isPermanent has a default value: true
      isPermanent: 'true',
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}
